package com.zld.smarket.controller;

import com.zld.smarket.result.ResponseData;
import com.zld.smarket.service.OnshelvesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
@CrossOrigin
@RequestMapping("/onshelves")
public class OnshelvesController {
    @Autowired
    private OnshelvesService onshelvesService;

    @RequestMapping(value = "/list",method = RequestMethod.GET)
    public ResponseData findList(Integer page, Integer limit){
        return  onshelvesService.findList(page,limit);
    }

    @RequestMapping(value = "/search",method = RequestMethod.GET)
    public ResponseData search(String s,Integer page, Integer limit){
        return  onshelvesService.search(s,page,limit);
    }
}
